﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace sXNAke
{
    class Pill
    {
        Texture2D texture;
        Vector2 position;
         public Rectangle collisionRect;
         Random random;
        GameWindow Window;
        public bool visible = true;

        public Pill(Texture2D texture, GameWindow Window)
        {
            this.texture = texture;
            this.Window = Window;
            this.random = new Random();
            this.position = new Vector2(random.Next(Window.ClientBounds.Width - this.texture.Width),
                random.Next(Window.ClientBounds.Height - this.texture.Height));
        }

        public void Update()
        {
            collisionRect = new Rectangle((int)position.X, (int)position.Y, texture.Width, texture.Height);
        }

        public void Draw(SpriteBatch spriteBatch)
        {
            if(visible)
            spriteBatch.Draw(texture, position, Color.Blue);
        }
    }

}
